import React, { useState } from 'react'

export default function App() {
  let [person , setPerson] = useState([{
    id : '01',
    name : '小明'
  },{
    id : '02',
    name : '小红'
  },{
    id : '03',
    name : '小花'
  },])
  return (
    <div>
       <button onClick = {() => {setPerson([...person,{id : Date.now(),name : '小黑'}])}}>点击添加数据</button>
       <ul>
          {
            person.map(item => {
              return <li key = {item.id}>{item.name}</li>
            })
          }
       </ul>
    </div>
  )
}
